package day05.StringBuiders;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/26
 */
public class Test4 {
    public static void main(String[] args) {
        String str1 = "Hello, World!";
        String str2= reverseString(str1);
        System.out.println("原始字符串: " + str1);
        System.out.println("反转后的字符串: " + str2);
    }

    public static String reverseString(String str) {
        StringBuilder sb = new StringBuilder(str);
        sb.reverse();
        return sb.toString();
    }
}
